import { Component,  OnInit } from '@angular/core';
import { LOCAL, SESSION } from 'src/app/common/utils/storage';

@Component({
  selector: 'app-test',
  templateUrl: './test.component.html',
  styleUrls: ['./test.component.less']
})
export class TestComponent implements OnInit {

  constructor() { }

  ngOnInit() {
    this.initData()
  }
  initData() {
    SESSION.set("test",'testStr')
    SESSION.set("obj",{a:"asd"})
    setTimeout(() => {
      console.log(SESSION.get("obj"))
      SESSION.del("obj")
    },12000)
    LOCAL.set('testLocal','str')
    LOCAL.set('LocalArr',[123])
    LOCAL.set('numberLocal',12434352)
    LOCAL.set('objLocal',{obj:1234})

    SESSION.set('fn',function() {console.log(123);
    })
  }
}
